package strings;

/**
 * 约瑟夫环
 * @author le
 */
public class JosephusKiller
{
    public static void main(String[] args)
    {
        int n = 4;
        int m = 2;
        int s = 0;
        for (int i = 1;i < n;i++){
            s = (s + m) % i;
            System.out.println(s+" "+i);
        }
        System.out.println(s+1);
    }
}
